#pragma once
#include <iostream>

// 已监听套接字的IO操作类
class SocketIO
{
public:
    explicit SocketIO(int fd);
    ~SocketIO();
    size_t readn(char *buf, size_t len); // 读入buf len 个字节
    size_t writen(const char* buf, size_t len); // 将buf写入缓冲区
    size_t readLine(char *buf, size_t len);
private:
    int _fd;

};